/**
 * @author zhengjiachao
 * @since 2017-3-27
 */
BCP.bill.control.Subtable = function(){
    BCP.bill.control.Subtable.superclass.constructor.call(this);
};

COM.util.defineClass(BCP.bill.control.Subtable, ADF.ControlDescriptor,{

    getEditpart : function(){
        var editpart = function(){
            editpart.superclass.constructor.call(this);
        };
        COM.util.defineClass(editpart, ADF.editpart.BaseEditpart, {
            _createFigure: function() {
                var figure = new AGEF.WidgetFigure(this.id);
                var subtable = this.getWidgetFactory().createControl(this.getModel());
                figure.setWidget(subtable);
                return figure;
            },
            // createEditPolicies: function() {
            //     this.installEditPolicy(COM.gef.EditPolicy.COMPONENT_ROLE, new AGEF.ComponentEditPolicy());
            // },
            propertyChange: function(evt) {
                editpart.superclass.propertyChange.call(this, evt);
                if (AGEF.PropertyChangeEvent.UPDATE_EVENT == evt.getType()) {
                    if (BCP.bill.model.SubtableModel.PROPERTY_INIT_DATA == evt.getPropertyName()) {
                        this.getFigure().getWidget().setInitData(evt.newValue);
                    }
                }
            }
        });
        return editpart;
    },

    getModel : function(){
        return BCP.bill.model.SubtableModel;
    },

    getDomControl:function(){
        return BCP.bill.domControl.Subtable;
    }

});